package dao;


import java.util.List;
import entities.Delegation;
import entities.LinkAssociation;
import entities.OwnerAssociation;
import entities.Sheet;
import entities.SmallSheet;
import entities.TreeAssociation;
import entities.ValueAndType;

public interface IDaoAsof extends IDao {
	public void addSheet(Sheet sheet);
	public void updateSheet(Sheet sheet);
	public void removeSheet(Sheet sheet);
	
	public void addSheets(List<Sheet> sheets);
	public void updateSheets(List<Sheet> sheets);
	public List<Sheet> findSheetsByPropertyLike(String propertyName, String propertyValue, String type);
	public List<Sheet> findSheetsByProperty(String propertyName, String propertyValue, String type);
	public List<Sheet> findSheetsByProperty(String propertyName, List<ValueAndType> values);
	public void removeSheets(List<Sheet> sheets);
	public void removeAllSheets(String type);
	
	public void addDelegation(Delegation delegation);
	public void addDelegations(List<Delegation> delegations);
	public List<Delegation> findDelegations(List<Delegation> delegations);
	public List<Delegation> findGivenDelegations(String ownerCode);
	public List<Delegation> findReceivedDelegations(String personCode);
	public void removeDelegation(Delegation delegation);
	public void removeDelegationById(long id);
	public void removeDelegations(List<Delegation> delegations);
	public void removeDelegationsByIds(List<Long> ids);
	public void removeDelegationsByOwnerAndSheet(List<OwnerAssociation> ownerAssociations);
	public void removeAllDelegations();
	public boolean personHasDelegationForSheet(String personCode, String sheetCode);
	
	public void addOwnerAssociation(OwnerAssociation ownerAssociation);
	public void addOwnerAssociations(List<OwnerAssociation> ownerAssociations);
	public List<OwnerAssociation> findOwnerAssociations();
	public List<OwnerAssociation> findOwnerAssociations(String ownerCode);
	public List<OwnerAssociation> findOwnerAssociationsBySheetType(String sheetType);
	public void removeOwnerAssociation(OwnerAssociation ownerAssociation);
	public void removeOwnerAssociation(long id);
	public void removeOwnerAssociations(List<OwnerAssociation> ownerAssociations);
	public void removeOwnerAssociationsByIds(List<Long> ids);
	//public int removeOwnerAssociationsByType(List<String> sheetTypes);
	public void removeAllOwnerAssociations();
	public boolean personOwnsSheet(String personCode, String sheetCode);
	
	public void addTreeAssociation(TreeAssociation treeAssociation);
	public void addTreeAssociations(List<TreeAssociation> treeAssociations);
	public List<TreeAssociation> findTreeAssociations(String parentCode, String childType);
	public List<TreeAssociation> findTreeAssociationsByTypes(String parentType, String childType);
	public List<String> findChildrenTypes(String parentCode);
	public List<String> findRootTypes();
	public List<TreeAssociation> findRootTreeAssociationsByType(String type);
	public void removeTreeAssociation(TreeAssociation treeAssociation);
	public void removeTreeAssociations(List<TreeAssociation> treeAssociations);
	public int removeTreeAssociationsByTypes(List<String> parentTypes, List<String> childTypes);
	
	public void addLinkAssociation(List<LinkAssociation> linkAssociation);
	public List<String> findLinkAssociationLabels(String sheetCode, String sheetType);
	public List<LinkAssociation> findLinkAssociationByLabel(String sheetCode, String sheetType, String label);
	public int removeLinkAssociation(String from, String to);
	
	public List<SmallSheet> findAllSmallSheets(String type);
}
